package com.cn.wanxi.servlet;

import com.cn.wanxi.model.DesignerModel;
import com.cn.wanxi.model.ProductModel;
import com.cn.wanxi.service.AboutService;
import com.cn.wanxi.service.ProductService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/about")
public class AboutServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        CommonServlet.setCompanyAndNavData(req);

        AboutService aboutService = new AboutService();
        DesignerModel[] designerModels = aboutService.getDesignerModels();
        req.setAttribute("designerModels", designerModels);

        req.getRequestDispatcher("/jsp/about.jsp").forward(req, resp);
    }
}
